#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <unistd.h>

int main(int argc, const char *argv[])
{
	key_t key1=ftok("./1.txt",'a');
	int shmid=shmget(key1,4096,IPC_CREAT|0664);
	char *buf;
	while(1)
	{
		buf=(char *)shmat(shmid,NULL,0);
		sleep(1);
		printf("%s\n",buf);
	}


	return 0;
}
